<html>
<head><meta charset="utf-8"><title>Expose a `cfg_if!` macro from libcore? · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Expose.20a.20.60cfg_if!.60.20macro.20from.20libcore.3F.html">Expose a `cfg_if!` macro from libcore?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="212453526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Expose%20a%20%60cfg_if%21%60%20macro%20from%20libcore%3F/near/212453526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Expose.20a.20.60cfg_if!.60.20macro.20from.20libcore.3F.html#212453526">(Oct 06 2020 at 16:37)</a>:</h4>
<p>ISTM like this occupies a similar niche to the <code>matches!</code> macro in that it's common, useful (much nicer than directly invoking <code>#[cfg()]</code>), but often not worth pulling in as a separate dependency for simple cases. I think libcore would also be able to use it internally in some places — is there any reason not to do this?</p>



<a name="212462348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Expose%20a%20%60cfg_if%21%60%20macro%20from%20libcore%3F/near/212462348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Expose.20a.20.60cfg_if!.60.20macro.20from.20libcore.3F.html#212462348">(Oct 06 2020 at 17:54)</a>:</h4>
<p>This was discussed a while ago and I think the conclusion was that it isn't clear if <code>cfg_if!</code> is even a good interface to offer for cfgs</p>



<a name="212468478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/Expose%20a%20%60cfg_if%21%60%20macro%20from%20libcore%3F/near/212468478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/Expose.20a.20.60cfg_if!.60.20macro.20from.20libcore.3F.html#212468478">(Oct 06 2020 at 18:44)</a>:</h4>
<p>It's a little verbose but it's a lot cleaner than the current alternative. What are the other options?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>